package cn.wenhe9.yygh.hosp.repository;

import cn.wenhe9.yygh.model.hosp.Department;
import org.apache.ibatis.annotations.Update;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @author DuJinliang
 * 2022/3/27
 */
@Repository
public interface DepartmentRepository extends MongoRepository<Department, String> {
    Optional<Department> findDepartmentByHoscodeAndDepcodeAndIsDeletedEquals(String hoscode, String depcode, int isDeleted);

    Optional<Department> findDepartmentByHoscodeAndDepcode(String hoscode, String depcode);


    Page<Department> findAllByHoscodeAndIsDeletedEquals(String hoscode, Pageable pageable, int isDelete);

    List<Department> findAllByHoscode(String hoscode);
}
